//
//  WYTaskCell.m
//  Boss
//
//  Created by admin on 2018/6/28.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYTaskCell.h"
@interface WYTaskCell()




@end
@implementation WYTaskCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self.doneBtn setCornerRadius:4.f];
    
    self.titleNameLabel.font = kFontSystemBIgger2(14);
    self.descNameLabel.font = kFontSystemBIgger2(10);
    
    
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setModel:(WYTaskListModel *)model
{
    _model = model;
    self.titleNameLabel.text = model.taskName;
    self.descNameLabel.text  = model.taskComment;
    if (model.state.integerValue) {
        [self.doneBtn setTitle:@"已完成" forState:UIControlStateNormal];
       // [self.doneBtn setBackgroundColor:[UIColor hexStringToColor:@"#FC9961" alpha:1.0]];
        self.doneBtn.enabled = NO;
    }else{
        [self.doneBtn setTitle:model.buttonName forState:UIControlStateNormal];
      //  [self.doneBtn setBackgroundColor:[UIColor hexStringToColor:@"#d8593f" alpha:1.0]];
        self.doneBtn.userInteractionEnabled = YES;
    }
    
    
   // if (self.taskModel.yearVip.integerValue) {
        //                [cell.doneBtn setTitle:@"已完成" forState:UIControlStateNormal];
        //                 [cell.doneBtn setBackgroundColor:[UIColor hexStringToColor:@"#FC9961" alpha:1.0]];
        //                cell.doneBtn.enabled = NO;
        //            }else{
        //                [cell.doneBtn setTitle:@"去完成" forState:UIControlStateNormal];
        //                  [cell.doneBtn setBackgroundColor:[UIColor hexStringToColor:@"#d8593f" alpha:1.0]];
        //                cell.doneBtn.userInteractionEnabled = YES;
        //            }
    
    
    
    
}






- (IBAction)clickDoneAction:(id)sender {
    
    if ([self.delegate respondsToSelector:@selector(clickDone:)]) {
        [self.delegate clickDone:self];
    }
    
    
}

@end
